//index.js
//获取应用实例
var app = getApp();

Page({
  data: {
  },
  onLoad: function () {
    var that = this;
    // 通讯
    wx.request({
      url: app.globalData.base_url,
      header: {
        'Content-Type': 'application/json;charset=UTF-8;'
      },
      method: "POST",
      data: {
        "ActionType": "login/wxLogin",
        "DataDictionary": {
          "CUSTOMER_ID": wx.getStorageSync('user_id')
        }
      },
      success: function (res) {
        if (res.data.code === 200) {
          wx.switchTab({
            url: '../search/search',
          })
        } else {
          wx.redirectTo({
            url: '/pages/login1/login1',
          })
        }
      }
    })
  }
})
